package lab2;
import static org.junit.Assert.*;

import org.junit.Test;
public class JTest {
    @Test
    public void testSize() {
    		TreeSet a = new TreeSet();
            assertEquals(0, a.size());
            a.add(1);
            assertEquals(1, a.size());
            a.add(2);
            a.add(-1);
            assertEquals(3, a.size());
            a.remove(-1);
            assertEquals(2, a.size());
    }
    @Test
    public void testAdd() {
    		TreeSet a = new TreeSet();
            assertTrue(a.add(1));
    }
    @Test
    public void testRemove() {
    		TreeSet a = new TreeSet();
    		a.add(1);
            assertTrue(a.remove(1));    
    }
    @Test
    public void testIsEmpty() {
    		TreeSet a = new TreeSet();
    		a.add(1);
    		a.remove(1);
            assertTrue(a.isEmpty());    
    }
    @Test
    public void testContains() {
    		TreeSet a = new TreeSet();
    		a.add(1);
            assertTrue(a.contains(1));    
    }
}
